import axios from "@/axios"

export function getArticleDetail(articleId) {
    return axios.post("/admin/article/detail", {articleId})
}

export function publishArticle(data) {
    return axios.post("/admin/article/publish", data)
}

export function getArticlePageList(data) {
    return axios.post("/admin/article/list", data)
}

/**
 * 删除文章
 * @param {*} data 
 * @returns 
 */
export const deleteArticle = (articleId) => {
    return axios.post("/admin/article/delete", articleId)
}

/**
 * 置顶文章
 * @param {*} is_top关键字
 * @returns 
 */
export const topArticle = (data) => {
    return axios.post("/admin/article/top", data)
}

export function updateArticle(data) {
    return axios.post("/admin/article/update", data)
}